package com.itcg.cn.Demo;

import java.util.Scanner;

public class Test01 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入一个字符串");
        String line = sc.nextLine();
        char[] arrayA = line.toCharArray();
        int english = 0;
        int num = 0;
        for (int i = 0; i < arrayA.length; i++) {
            if (Character.isLetter(arrayA[i])) {
                english++;
            }
            if (Character.isDigit(arrayA[i])) {
                num++;
            }
        }
        System.out.println("英文字母有: " + english);
        System.out.println("数字有:" + num);
    }
}
